﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LPY.LeHealth.DTO;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;

namespace LPY.LeHealth.DAL
{
  public   class tibaodal
    {
        string constring = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
        /// <summary>
        /// 显示体检报告
        /// </summary>
        /// <returns></returns>
        public List<tibaoDTO> show()
        {
            StringBuilder str = new StringBuilder();
            List<tibaoDTO> list = new List<tibaoDTO>();
            string sql = " select * from t_tibao";
            SqlDataAdapter ad = new SqlDataAdapter(sql, constring);
            DataTable dt = new DataTable();
            ad.Fill(dt);
            foreach (DataRow i in dt.Rows)
            {
                tibaoDTO com = new tibaoDTO();
                com.tbid = Convert.ToInt32(i["tbid"]);
                com.tbname = i["tbname"].ToString();
                com.tbcontent = i["tbcontent"].ToString();
                com.UserId = Convert.ToInt32(i["id"]);
                com.tbstate=i["tbstate"].ToString();
                list.Add(com);

            }
            return list;




        }
    }
}
